import { waitObject } from "../util/wait.js";

/*!
 * 把回复按钮放到预览区上面
 */
export async function moveReplyButtonUp() {
    const [replyArea, preview, buttons] = await waitObject(
        () => {
            const preview = document.getElementById("editor-preview-wrap");
            if (!preview) { return; }
            const buttons = preview.nextElementSibling;
            if (!buttons) { return; }
            const replyArea = preview.parentElement;
            return [replyArea, preview, buttons];
        }
    );

    replyArea.insertBefore(buttons, preview);
    buttons.classList.remove("mt-3");
    buttons.classList.add("mb-3");
}
